package org.ykh.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.ykh.springcloud.entities.CommonResult;
import org.ykh.springcloud.entities.Payment;
import org.ykh.springcloud.service.PaymentFeignService;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * @author ykh
 * @create 2022-01-03 22:17
 */
@RestController
@Slf4j
public class OpenFeign_OrderController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/getPaymentById/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id")Long id){
        log.info("开始处理请求");
        return paymentFeignService.getPaymentById(id);
    }
    @GetMapping("/consumer/payment/timeout")
    public CommonResult OpenFeignTimeout(){
        return paymentFeignService.OpenFeignTimeout();
    }
}
